<@page.html title="手动生成报表">
<script type="text/javascript" src="${_appPath!}/js/cal.js"></script>
<script type="text/javascript" src="${_appPath!}/js/DatePicker.js"></script>
  <div class="search">
    <form id="fm_query" >
      <dl>
        <dt>TB-总表生成日期</dt>
        <dd><input type="text" id="tbReportDate" class="date" name="tbReportDate" onfocus="cal(this);" /></dd>
        <dd class="button"><input type="button" value="生成TB总表" onclick="save('_createtb');"></dd>
      </dl>
      <dl>
        <dt>Cashier Report总表生成日期</dt>
        <dd><input type="text" id="crReportDate" class="date" name="crReportDate" onfocus="cal(this);" /></dd>
        <dd class="button"><input type="button" value="生成Cashier Report总表" onclick="save('_createcr');"></dd>
      </dl>
      <dl>
        <dt>DPR日报表生成日期</dt>
        <dd><input type="text" id="dprReportDate" class="date" name="dprReportDate" onfocus="cal(this);" /></dd>
        <dd class="button"><input type="button" value="生成DPR日报表" onclick="save('_createdaydpr');"></dd>
      </dl>
      <dl>
        <dt>剩余定金统计报表生成月份</dt>
        <dd><input id="depositMonth" name="depositMonth" type="text" onclick="setmonth(this)" readonly="readonly" /></dd>
        <dd class="button"><input type="button" value="生成剩余定金统计报表" onclick="save('_createdeposit');"></dd>
      </dl>
      <dl>
        <dt>DPR月报表生成月份</dt>
        <dd><input id="dprmonth" name="dprmonth" type="text" onclick="setmonth(this)" readonly="readonly" /></dd>
        <dd class="button"><input type="button" value="生成DPR月报表" onclick="save('_createmonthdpr');"></dd>
      </dl>
      
      <dl>
        <dt>DPR日期</dt>
        <dd><input type="text" id="dateFrom" class="date" name="dateFrom" value="" onfocus="cal(this);" />
          ~ <input type="text" id="dateTo" class="date" name="dateTo" value="" onfocus="cal(this);" /></dd>
        <dd class="button"><input type="button" value="DPR期间报表生成" onclick="download();"></dd>
      </dl>
    </form>
  </div>
<script type="text/javascript">
function save(action) {
    var fm = getEl("fm_query");
    postForm(action, fm, saveRet);
    return false;
}
function saveRet(data) {
    window.alert(data.msg);
}

function download(){
    var dateFrom = document.getElementById("dateFrom").value;
    var dateTo = document.getElementById("dateTo").value;
	window.location.href='${_appPath!}/createRpt/_createdayfromtodpr?dateFrom='+dateFrom +'&dateTo='+dateTo;
}
</script>
</@page.html>